package com.globalLogic.gps.graph.algorithms;

public class Node implements Comparable<Node> {
    public String id;
    public int  distance   = Integer.MAX_VALUE;
    public  Node origin = null;
    public Node(String x, int d, Node p) { id=x; distance=d; origin=p; }
    public Node(String x) { this(x, 0, null); }
    public int compareTo(Node tmp) { return this.distance-tmp.distance; }
    public boolean equals(Object o) {
        Node tmp = (Node) o;
        if(tmp.id.equals(this.id)) return true;
        return false;
    }
	@Override
	public String toString() {
		return "Node [distancia=" + distance + ", id=" + id + ", procedencia="
				+ origin +"]";
	}
    
    
}